 
<header id="header" class="mui-bar mui-bar-black mui-bar-nav">
    <a class="mui-icon mui-icon-left-nav mui-pull-left" href="{:url('site/site_list')}"></a>
    <h1 class="mui-title">{$result.building_name}</h1>
</header>
{include file="site/site_nav" /}
<div class="mui-content mui-content-my project-log" style="padding-top: 0;margin-top: 1em">
    <div class="project-log-search-bg">
        <div class="project-log-search">
            <input data-options='{"type":"date"}' value='{$startTime}' id="startTime" type="text" placeholder="选择开始时间">
            <input data-options='{"type":"date"}'  value='{$endTime}' id="endTime" type="text" placeholder="选择结束时间">
            <a class="search-btn" href="#"></a>
        </div>
    </div>
    <ul class="project-log-con">


 {volist name="dd" id="vv"}  
        <li>
            <div class="project-log-left">
               {$key}
            </div>
            <div class="project-log-right">

            </div>
        </li>
        {volist name="vv.data" key='k' id="v"}  
        <li class="<?php if($k%2==1){ echo 'time-h'; }else{echo 'time-b';} ?>">
            <div class="project-log-left">
            <?php echo date("H:i:s",$v['log_time']);?> 
            </div>
            <div class="project-log-right">
                <a href="{:url('log/log_detail',array('id'=>$v['id']))}">
                <p>提交人：{$v.user_name}</p>
                <p> 类  型：
                   <?php if($v['log_type'] ==1){echo '<span class="ordinary">普通</span>'; }else{echo '<span class="danger">风险</span>';} ?>  
                </p>
                </a>
            </div>
        </li>
        {/volist} 
    
{/volist}   
    </ul>
</div>
<script src="__CDN__/style/js/jquery-1.11.3.js"></script>
<script src="__CDN__/style/js/mui.poppicker.js"></script>
<script src="__CDN__/style/js/mui.picker.min.js"></script>
<script>
    (function ($,doc) {
        $.init();
        var result = $('#userResult')[0];
        var btns = $('.project-log-search input');
        btns.each(function(i, btn) {
            btn.addEventListener('tap', function() {
                var optionsJson = this.getAttribute('data-options') || '{}';
                var options = JSON.parse(optionsJson);
                var picker = new $.DtPicker(options);
                picker.show(function(rs) { 
                    btns[i].value = rs.text;
                    console.log(i);
                    picker.dispose();
                    if(i ==1 ){   
                        if(btns[0].value.replace(/-/g,"")>btns[1].value.replace(/-/g,"")){
                            alert('起始时间不得大于结束时间');
                        }else{
                            location.href="/index/site/site_log/id/{$result.id}/startTime/"+btns[0].value+"/endTime/"+btns[1].value+".html";  
                        }
                    }
                });
            }, false);
        });
    })(mui,document);
    $(function () {
        var startX=0,startY=0,moveEndX=0,moveEndY=0,X=0,Y=0,nowX=0;
        var a=$("#navBar");
        var navWidth=parseInt(a.css('width'));
        //var ulWidth=parseInt(a.children().css('width'));
        var ulWidth=parseInt(a.children().children().css('width'))*7+20;
        a.children().css('width',ulWidth);

        a.on("touchstart", function(e) {
            // e.preventDefault();
            startX = e.originalEvent.changedTouches[0].pageX;
            startY = e.originalEvent.changedTouches[0].pageY;
            nowX=parseInt(a.children().css('left'));
        });
        a.on("touchmove", function(e) {
            // e.preventDefault();
            moveEndX = e.originalEvent.changedTouches[0].pageX;
            moveEndY = e.originalEvent.changedTouches[0].pageY;
            X = moveEndX - startX;
            Y = moveEndY - startY;
            if ( Math.abs(X) > Math.abs(Y) && X > 0 ) {
                // alert("left 2 right");
                //console.log(X,Y);
                if((X+nowX)<0){
                    a.children().css('left',(X+nowX)+'px');
                }
            }
            else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
                //alert("right 2 left");
                //console.log(navWidth,ulWidth,navWidth-ulWidth);
                //console.log(liWidth);
                if((X+nowX)>(navWidth-ulWidth)){
                    a.children().css('left',(X+nowX)+'px');
                }
            }
            else if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
                //alert("top 2 bottom");
            }
            else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
                //alert("bottom 2 top");
            }
            else{
                //alert("just touch");
            }
        });
    });
</script>
 